package com.glsc.ngateway.common.base.domain.mysql.gateway.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Entity
@Data
@Table(name = "t_gw_system_vendor_log_info")
@org.hibernate.annotations.Table(appliesTo = "t_gw_system_vendor_log_info",comment = "供应商访谈评级表")
public class SystemVendorLogInfo implements Serializable {

    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "varchar(10) comment '主键'")
    private Integer id;

    @ApiModelProperty(value = "供应商id")
    @Column(name = "vendor_id", columnDefinition = "varchar(10) comment '供应商id'")
    private String vendorId;

    @ApiModelProperty(value = "供应商编码")
    @Column(name = "vendor_code", columnDefinition = "varchar(10) comment '供应商编码GL+VENDOR+1001'")
    private String vendorCode;

    @ApiModelProperty(value = "供应商名称")
    @Column(name = "vendor_name", columnDefinition = "varchar(200) comment '供应商名称'")
    private String vendorName;

    @ApiModelProperty(value = "发生时间")
    @Column(name = "occur_time", columnDefinition = "varchar(20) comment '发生时间'")
    private String occurTime;

    @ApiModelProperty(value = "事件类型")
    @Column(name = "type", columnDefinition = "char(1) comment '事件类型 1 年度评价 2 事件 3 访谈'")
    private String type;

    @ApiModelProperty(value = "信息描述")
    @Column(name = "log_info", columnDefinition = "text comment '信息描述'")
    private String logInfo;

    @ApiModelProperty(value = "删除状态")
    @Column(name = "deleted", columnDefinition = "int(1) comment '删除状态'")
    private Integer deleted;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

//    @ApiModelProperty(value = "操作标记")
//    @Column(name = "log_flag", columnDefinition = "int(8) comment '操作标记 0增加 1修改 2删除'")
//    private Integer logFlag;

}
